home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_024 / conquest / conqd3.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  4KB  |  125 lines

  1. #include <stdio.h>
  2. #include "defs.h"
  3. #include "structs.h"
  4. #include "vars.h"
  5.  
  6. print_col()
  7. {
  8.         int i; 
  9.         boolean see;
  10.         tplanet *pplanet;
  11.         printf("olonies:");
  12.         point(50,1);
  13.         for ( i= 1 ; i<=nstars; i++ ) {
  14.                 pplanet=stars[i].first_planet;
  15.                 while ( pplanet != nil ) {
  16.                         if ( (pplanet->team) == player ) {
  17.                                 putchar(i+'A'-1);
  18.                 see = true;
  19.         if ( ((y_cursor > 21) && (x_cursor >= 50)) ||
  20.             (y_cursor > 24) ) {
  21.                 pause();
  22.                 clear_field();
  23.                 point(50,1);
  24.         };
  25.         printf("%d:%2d                         ", pplanet->number, pplanet->psee_capacity);
  26.         point(x_cursor + 5, y_cursor);
  27.         x_cursor = x_cursor - 5;
  28.         if ( pplanet->psee_capacity==0 )
  29.                 printf(" Decimated");
  30.         else if ( (pplanet->team==none) && see )
  31.                 printf(" No colony");
  32.         else if ( pplanet->team==player ) {
  33.                 printf("(%2d,/%3d)", pplanet->inhabitants, pplanet->iu);
  34.                 if ( pplanet->conquered )
  35.                         printf("Con");
  36.                 else
  37.                         printf("   ");
  38.                 if ( pplanet->mb!=0 )
  39.                         printf("%2dmb", pplanet->mb);
  40.                 else
  41.                         printf("    ");
  42.                 if ( pplanet->amb!=0 )
  43.                         printf("%2damb", pplanet->amb);
  44.         } 
  45.         else if ( (pplanet->team==ENEMY) && see ) {
  46.                 printf("*EN*");
  47.                 if ( see && pplanet->conquered ) {
  48.                         printf("Conquered");
  49.                 } 
  50.                 else
  51.                         printf("   ");
  52.                 if ( pplanet->under_attack ) {
  53.                         if ( pplanet->mb != 0 )
  54.                                 printf("%2dmb", pplanet->mb);
  55.                         else
  56.                                 printf("    ");
  57.                         if ( pplanet->amb != 0 )
  58.                                 printf("%2damb", pplanet->amb);
  59.                 };
  60.         };
  61.         point(x_cursor,y_cursor + 1);
  62.  
  63.                         };
  64.                         pplanet=pplanet->next;
  65.                 };
  66.         };
  67.         clear_field();
  68.         cle3r_left();
  69. }
  70.  
  71.  
  72.  
  73. starsum()
  74. {
  75.         char iline[81];  
  76.         int ind,i,value;  
  77.         char strs;
  78.         printf("tar summary:");
  79.         cle3r_left();
  80.         point(1,19);
  81.         putchar(':');
  82.  
  83.         get_line(iline,&ind,true);
  84.         get_token(iline,&ind,&value,&strs);
  85.         point(50,1);
  86.         if ( strs == ' ' ) {
  87.                 for ( i= 1 ; i<=nstars; i++ ) pr5nt_star(i);
  88.         } 
  89.         else {
  90.                 do {
  91.                         i = strs-'A'+1;
  92.                         pr5nt_star(i);
  93.                         get_token(iline,&ind,&value,&strs);
  94.                 } 
  95.                 while (strs != ' ');
  96.         };
  97.         clear_field();
  98. }
  99.  
  100. tfsum()
  101. {
  102.         int i, value;  
  103.         char tfs;
  104.         char iline[81];  
  105.         int ind;
  106.         printf("f summary :");
  107.         get_line(iline,&ind,true);
  108.         get_token(iline,&ind,&value,&tfs);
  109.         point(50,1);
  110.         if ( tfs==' ' ) {
  111.                 for ( i= 1 ; i<=26; i++ ) pr3nt_tf(i);
  112.         } 
  113.         else {
  114.                 do {
  115.                         i = tfs - 'A' + 1;
  116.                         pr3nt_tf(i);
  117.                         get_token(iline,&ind,&value,&tfs);
  118.                 } 
  119.                 while (tfs != ' ');
  120.         };
  121.         clear_field();
  122.         cle3r_left();
  123. }
  124.  
  125.